package com.tingyuge.base.design.flyweight;

/**
 * 为内部对象,提供享元存储.!!
 * @Created by xiaodao
 */
public class ChessFlyWeightImpl implements ChessFlyWeight {
    private String color;

    public ChessFlyWeightImpl(String color) {
        this.color = color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getColor() {
        return this.color;
    }

    public void display(ChessCoordinateConcrete c) {

        System.out.println("chess's color = "+ color);
        System.out.println("chess;s position x = "+ c.getX() +"----- y = "+ c.getY());


    }
}
